<?php 

if(!defined('ADMIN')){
	exit('Access Denied');
}

if($modelid==0){
    $inforow=array();
    if($total>0){
        $inforow=$row[0];
    }
    $tid=$inforow["id"];
	srand(seed());
    $contentid=time()+mt_rand (0,10240000 );
?>

<div class="pageHeader">
	<p class="topnam"><b>内容发布 > <?=$catename?></b></p>
</div>
<div class="pageContent">
<form method="post" action="index.php?mod=content&act=addedi" class="pageForm required-validate" onsubmit="return validateCallback(this)">
<input type="hidden" name="sub" value="save" />
<input type="hidden" name="catid" value="<?=$catid?>" />
<input type="hidden" name="id" value="<?=$tid?>" />
<div class="pageFormContent nowrap" layoutH="100" style="overFlow-x: hidden;">
<dl>
<dt>标题：</dt>
<dd>
<input type="text" name="title" maxlength="200" style="width: 400px;" value="<?=$inforow["title"]?>" class="required" />
<span class="info">&nbsp;</span>
</dd>
</dl>
<dl>
<dt>关键字：</dt>
<dd>
<input type="text" name="keywords" maxlength="100"  style="width: 300px;" value="<?=$inforow["keywords"]?>"  />
<span class="info">&nbsp;多关键词之间用空格或者“,”隔开</span>
</dd>
</dl>
<dl>
<dt>缩略图：</dt>
<dd>
<input name="attachment.id" value="" type="hidden" />
<input type="text" name="attachment.fileName" class="readonly" style="width: 300px;" readonly="readonly" value="<?=$inforow["thumb"]?>"  />
<a class="btnPic" href="<?=u("content","upload")?>" lookupGroup="attachment" width="460" height="200" title="上传缩略图">附件</a>
<span class="info">&nbsp;选择本地图片文件</span>
</dd>
</dl>
<dl>
<dt>内容：</dt>
<dd>
<textarea id="content<?=$contentid?>" name="content"><?=$infocontent?></textarea>
<script type="text/javascript">
UE.getEditor('content<?=$contentid?>');
</script>
</dd>
</dl>
</div>
<div class="formBar">
<ul style="float:left;">
<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存内容</button></div></div></li>
<li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="javascript:window.open('/content.php?mod=news&act=view&id=<?=$tid?>');">预览内容</button></div></div></li>
</ul>
</div>
</form>
</div>
<?
}elseif($modelid==17){
    
    include_once("student.tpl.php");
    
    exit;

}elseif($modelid==19){
    include_once("jobslist.tpl.php");
    exit;

}elseif($modelid==18){
    include_once("companylist.tpl.php");
    exit;

}elseif($modelid==16){
    
    include_once("schoollist.tpl.php");
    exit;
  
     
}else{

if($modelid==2){
    $mname="新闻";
}elseif($modelid==11){
  $mname="产品";  
}else{
    $mname="内容";
}

?>
<div class="pageHeader">
	<p class="topnam"><b>内容发布 > <?=$catename?></b></p>
</div>
<form id="pagerForm" method="post" action="#rel#">
	<input type="hidden" name="pageNum" value="<?=$page?>" />
	<input type="hidden" name="numPerPage" value="<?=$pagesize?>" />
	<input type="hidden" name="orderField" value="<?=$orderField?>" />
	<input type="hidden" name="orderDirection" value="<?=$orderDirection?>" />
</form>
<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="<?=u(MOD,'list',array('q'=>$q,'catid'=>$catid,'status'=>$status))?>" method="post">
	<div class="searchBar">
		<ul class="searchContent">
        <table class="searchContent">
        <tr><td>查询内容：<input type="text" name="q" value="<?=$q?>" /></td>
        <td><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></td>
        </tr>
        </table>
	</div>
	</form>
</div>

<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
            <?if($ezhand->check_menu_access(MOD,'addedipage')){?>
			<li><a class="add" href="<?=u(MOD,'addedipage',array("catid"=>$catid))?>" target="navTab" rel="addedipage<?=$catid?>" title="新增内容"><span>新增内容</span></a></li>
            <?}?>
            <?if($ezhand->check_menu_access(MOD,'delpage')){?>
			<li><a title="确实要删除选择的内容吗?" target="selectedTodo" rel="ids[]" href="<?=u(MOD,'delpage')?>" class="delete"><span>删除</span></a></li>
            <?}?>
            <?if($ezhand->check_menu_access(MOD,'addedipage')){?>
			<li><a class="edit" href="<?=u(MOD,'addedipage',array('id'=>'{id}',"catid"=>$catid))?>"  target="navTab" rel="addedipage<?=$catid?>" warn="请选择一条记录"><span>修改</span></a></li>
            <?}?>
			<li class="line">line</li>
           
            <?if($ezhand->check_menu_access(MOD,'passok')){?>
             <li class="line">line</li>
            <li><a title="确实要审核通过选择的内容吗?" target="selectedTodo" rel="ids[]" href="<?=u(MOD,'passok')?>" class="passok"><span>通过审核</span></a></li>
            <?}?>
            <?
            if($ezhand->check_menu_access(MOD,'cancel')){
            ?>            
            <li><a title="确实要拒绝审核所选择的内容吗?" target="selectedTodo" rel="ids[]" href="<?=u(MOD,'cancel')?>" class="cancel"><span>拒绝审核</span></a></li>
            <li class="line">line</li>
            <?
            }
            ?>            
            
            <li class="line">line</li>
            <li><a title="已发布内容列表" target="navTab" rel="page<?=$catid?>" href="<?=u(MOD,'list',array("catid"=>$catid,"status"=>99))?>" class="list99"><span>已发布内容列表<? if($statuscount[99]>0){ echo "<font color=red>[".$statuscount[99]."]</font>";}?></span></a></li>
            <li><a title="待审核列表" target="navTab" rel="page<?=$catid?>" href="<?=u(MOD,'list',array("catid"=>$catid,"status"=>1))?>" class="list01"><span>待审核列表 <? if($statuscount[1]>0){ echo "<font color=red>[".$statuscount[1]."]</font>";}?></span></a></li>  
            <li><a title="草稿" target="navTab" rel="page<?=$catid?>" href="<?=u(MOD,'list',array("catid"=>$catid,"status"=>0))?>" class="list00"><span>草稿 <? if($statuscount[0]>0){ echo "<font color=blue>[".$statuscount[0]."]</font>";}?></span></a></li>  
            <li><a title="未通过审核列表" target="navTab" rel="page<?=$catid?>" href="<?=u(MOD,'list',array("catid"=>$catid,"status"=>14))?>" class="list14"><span>作废列表 <? if($statuscount[14]>0){ echo "<font color=gray>[".$statuscount[14]."]</font>";}?></span></a></li>          
		</ul>
	</div>
<form method="post" action="<?=u(MOD,'list')?>&id=<?=$id?>" rel="pagerForm"  onsubmit="return navTabSearch(this);">
<input type="hidden" name="sub" value="save" />
<input type="hidden" name="catid" value="<?=$catid?>" />  
	<table class="table" width="100%" layoutH="148">
		<thead>
			<tr>
				<th width="25"><input type="checkbox" group="ids[]" class="checkboxCtrl"></th>
				<th width="50" class="center" orderField="id" <? if($orderField=="id"){?>class="<?=$orderDirection?>"<?}?>>ID</th>
				<th orderField="title" <? if($orderField=="title"){?>class="<?=$orderDirection?>"<?}?>>名称</th>
                
				<th width="100" class="center">
                <?
                if($liststyle==1){
                    echo "缩略图";
                }else{
                    echo "点击量";
                    
                }
                ?>
                </th>
                <th width="100" class="center">发布人</th>
				<th width="130" class="center">发布时间</th>
				<th width="70" class="center">状态</th>
				<th width="70" orderField="sort" class="center" <? if($orderField=="sort"){?>class="<?=$orderDirection?>"<?}?>>排序</th>
				<th width="120" class="center">操作</th>
			</tr>
		</thead>
        <tbody>
        <?php foreach ($row as $r){?>
		<tr target="id" rel="<?=$r["id"]?>" style="height: 25px;line-height: 25px;">
				<td class="center"><input name="ids[]" value="<?=$r["id"]?>" type="checkbox" /></td>
				<td class="center"><?=$r["id"]?></td>
				<td class="contenttitle"><a href="/content.php?mod=news&act=view&id=<?=$r["id"]?>" target="_blank" style="font-weight: 700;"><?=$r["title"]?></a>
                <?
                if(!empty($r["thumb"])){
                    echo "<img src='images/picture.png' />";    
                }
                ?>
                
                </td>
				<td class="center">
                <?
               if($liststyle==1){
                
               
                if(!empty($r["thumb"])){
                ?> 
                 <img src="../<?=$r["thumb"]?>" height="80" />
                <?   
                }
                }else{
                    
                    echo $r["hits"];
                }
                ?>
                </td>
                <td class="center"><?=$r["username"]?></td>
				<td class="center"><?=date("Y-m-d H:i:s",$r["inputtime"])?></td>
				<td class="center"><?=$state_arr[$r["status"]]?></td>
				<td class="center"><?=$r["listorder"]?></td>
				<td class="center">
                <?
                if($catid=="75" or $catid=="76"  or $catid=="79"){
                
                }else{
                ?>
                   
                <?}?> 
                    
                    <a title="删除“<?=$r["title"]?>”？" target="ajaxTodo" href="<?=u(MOD,'delpage',array('id'=>$r['id']))?>" class="btnDel">删除</a>
					<a title="编辑" target="navTab" href="<?=u(MOD,'addedipage',array('catid'=>$catid,'id'=>$r['id']))?>" class="btnEdit">编辑</a>
				</td>
		</tr>
        <?php }?>   
		</tbody>
	</table>            
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})" id="PageSize">
				<option value="20" <? if($pagesize==20){ echo 'selected="true"';}?>>20</option>
				<option value="50" <? if($pagesize==50){ echo 'selected="true"';}?>>50</option>
				<option value="100" <? if($pagesize==100){ echo 'selected="true"';}?>>100</option>
				<option value="200" <? if($pagesize==200){ echo 'selected="true"';}?>>200</option>
			</select>
			<span>条，共<?php echo $total;?>条</span>
		</div>
		
		<div class="pagination" targetType="navTab" totalCount="<?php echo $total;?>" numPerPage="<?=$pagesize?>" pageNumShown="10" currentPage="<?=$page?>"></div>

	</div>
<!-- 
<div class="formBar">
<ul style="float:left;">
<li style="line-height: 30px;height: 30px;"><div style="width: 420px;"><a class="btnLook" href="<?=u("content","posids",array("v"=>""))?>" lookupGroup="posids" style="float:right">选择推荐位</a>选择推荐位：
<input name="posids.id" value="" id="positionids" type="hidden" /><input type="text" name="posids.orgName" style="width:300px"  value="" class="lookup" />
        
        <input class="readonly" name="posids.orgNum" readonly="readonly" type="hidden" /></div>
</li>
<li><div class="buttonActive"><div class="buttonContent"><button type="submit">推送到推荐位 </button></div></div></li>
</ul>
</div>
-->
</form>     
</div>    

<?
 if($liststyle==1){
    
    
    
    
 }else{
    
    
 }
    
    
}
?>